/* 相关保险  */
function getBaoXianJq(url){
	var busiId=$("#busiId").val();
	  var winWidth = $("#table_list_jiaoqiang").parent('div.business-padding').width();
   	  var winHeight = $(window).height() / 3;
      $.jgrid.defaults.styleUI = 'Bootstrap';
	  jQuery("#table_list_jiaoqiang").jqGrid({
	  url:url,
      datatype : "json",
      postData:{"busiId":busiId},
      colNames : [ '主键','保险年度', '保险公司', '保单号','续保/交强险确认人','交强险起始日','交强险到期日','交强险','车船税','交强险合计','投保方','出单日期','确认时间','交强险返利','交强险实收','审核人','审核时间'],
      colModel : [
				{name: 'busiId', hidden:true},
				{name: 'year',width: 100,align: "center",formatter:function(a,b,c){
               	   return '第'+a+'年';
                }},
				{name: 'companyInsuranceDisplay',width: 200,align: "center",sortable:false},
				{name: 'noInsurance',width: 170,align: "center",sortable:false},
				{name: 'operatorNextDisplay',width: 150,align: "center",sortable:false},
				{name: 'dateStart',width: 150,align: "center",sortable:false},
				{name: 'dateEnd',width: 150,align: "center",sortable:false},
				{name: 'costPerson',width: 100,align: "center",sortable:false},
				{name: 'costSpecial',width: 100,align: "center",sortable:false},
				{name: 'costTotal',width: 100,align: "center",sortable:false,formatter:function(cellvalue, options, rowObject){
					return cellvalue = rowObject.costPerson + rowObject.costSpecial;
				}},
				{name: 'objectInsureDisplay',width: 150,align: "center",sortable:false},
				{name: 'dateEffect',width: 150,align: "center",sortable:false},
				{name: 'timeConfirm',width: 150,align: "center",sortable:false},
				{name: 'amountRebate',width: 100,align: "center",sortable:false},
				{name: 'amountReceived',width: 100,align: "center",sortable:false},
				{name: 'auditor',width: 100,align: "center",sortable:false},
				{name: 'timeAudit',width: 150,align: "center",sortable:false}
				],
        mtype : "post",
        height: winHeight,
        width:winWidth,  
        shrinkToFit:false,
        autoScroll: false,
        rowNum: 15,
        rowList: [15, 30, 45],
        viewrecords: true,
        pager: "#pager_list_1",
        hidegrid: false,
        multiselect : false,
        altRows:true,
        altclass:'someClass',
        jsonReader : {
      	  root:"result.rows",
      	  page: "result.page",
      	  total: "result.total",
      	  records: "result.records",
      	  repeatitems: false,
      	  id: "replaceId"
        },
        loadComplete:function(datas){
        	console.log(datas);
      	  if (datas.flag == "100100") {
                layer.msg("查询成功!", {icon: 6, time: 1000});
                return;
            }
      	  
      	  if(datas.flag == '100802') {
				  top.location.href = thisLoginUrl;
				  return;
			  }
      	  
            layer.msg(datas.message, {icon: 2});
        }
    });
}

function getBaoXianSy(url){
	var busiId=$("#busiId").val();
	var winWidth = $("#table_list_shangye").parent('div.business-padding').width();
 	var winHeight = $(window).height() / 3;
    $.jgrid.defaults.styleUI = 'Bootstrap';
	jQuery("#table_list_shangye").jqGrid({
	url:url,
    datatype : "json",
    postData:{"busiId":busiId},
    colNames : [ '主键', '保险年度','保险公司', '保单号','续保/商业险确认人','商业险起始日','商业险到期日','商业险合计','出单日期','确认时间','商业险返利','商业险实收','审核人','审核时间','车辆损失险(保额)','车辆损失险(保费)','全车盗抢险(保额)','全车盗抢险(保费)','玻璃单碎险(保额)','玻璃单碎险(保费)','不计免赔险(保额)','不计免赔险(保费)','第三者责任(保额)','第三者责任(保费)','自燃险(保额)','自燃险(保费)','涉水险(保额)','涉水险(保费)','车上人员险(保额)','车上人员险(保费)','第三方特约险(保额)','第三方特约险(保费)'],
    colModel : [
				{name: 'busiId', hidden:true},
				{name: 'year',width: 100,align: "center",formatter:function(a,b,c){
               	   return '第'+a+'年';
                }},
				{name: 'companyInsuranceDisplay',width: 200,align: "center",sortable:false},
				{name: 'noInsurance',width: 170,align: "center",sortable:false},
				{name: 'operatorNextDisplay',width: 150,align: "center",sortable:false},
				{name: 'dateStart',width: 150,align: "center",sortable:false},
				{name: 'dateEnd',width: 150,align: "center",sortable:false},
				{name: 'costTotal',width: 100,align: "center",sortable:false,formatter:function(cellvalue, options, rowObject){
					return cellvalue = rowObject.costLoss + rowObject.costSteal + rowObject.costGlass + rowObject.costAoad + rowObject.costThird + rowObject.costIgnition + rowObject.costWade + rowObject.costPerson + rowObject.costSpecial;
				}},
				{name: 'dateEffect',width: 150,align: "center",sortable:false},
				{name: 'timeConfirm',width: 150,align: "center",sortable:false},
				{name: 'amountRebate',width: 100,align: "center",sortable:false},
				{name: 'amountReceived',width: 100,align: "center",sortable:false},
				{name: 'auditor',width: 100,align: "center",sortable:false},
				{name: 'timeAudit',width: 150,align: "center",sortable:false},
				{name: 'limitLoss',width: 150,align: "center",sortable:false},
				{name: 'costLoss',width: 150,align: "center",sortable:false},
				{name: 'limitSteal',width: 150,align: "center",sortable:false},
				{name: 'costSteal',width: 150,align: "center",sortable:false},
				{name: 'limitGlass',width: 150,align: "center",sortable:false},
				{name: 'costGlass',width: 150,align: "center",sortable:false},
				{name: 'limitAoad',width: 150,align: "center",sortable:false},
				{name: 'costAoad',width: 150,align: "center",sortable:false},
				{name: 'limitThird',width: 150,align: "center",sortable:false},
				{name: 'costThird',width: 150,align: "center",sortable:false},
				{name: 'limitIgnition',width: 150,align: "center",sortable:false},
				{name: 'costIgnition',width: 150,align: "center",sortable:false},
				{name: 'limitWade',width: 150,align: "center",sortable:false},
				{name: 'costWade',width: 150,align: "center",sortable:false},
				{name: 'limitPerson',width: 150,align: "center",sortable:false},
				{name: 'costPerson',width: 150,align: "center",sortable:false},
				{name: 'limitSpecial',width: 150,align: "center",sortable:false},
				{name: 'costSpecial',width: 150,align: "center",sortable:false}
				],
      mtype : "post",
      height: winHeight,
      width:winWidth,  
      shrinkToFit:false,
      autoScroll: false,
      rowNum: 15,
      rowList: [15, 30, 45],
      viewrecords: true,
      pager: "#pager_list_2",
      hidegrid: false,
      multiselect : false,
      altRows:true,
      altclass:'someClass',
      jsonReader : {
    	  root:"result.rows",
    	  page: "result.page",
    	  total: "result.total",
    	  records: "result.records",
    	  repeatitems: false,
    	  id: "replaceId"
      },
      loadComplete:function(datas){
    	  if (datas.flag == "100100") {
              layer.msg("查询成功!", {icon: 6, time: 1000});
              return;
          }
    	  
    	  if(datas.flag == '100802') {
				  top.location.href = thisLoginUrl;
				  return;
			  }
    	  
          layer.msg(datas.message, {icon: 2});
      }
  });
}